<% form_for [:admin, @product], :url => path , :html => {:class => :form , :multipart => true} do |form| %>
  <table class="data2 data3" cellspacing="0">
    <tr>
      <th><label><%= Product.human_attribute_name("productcategory_id") %>:</label></th>
      <td>
        <%= form.select :productcategory_id, Productcategory.all.map{|c| [c.name ,c.id]} %><span class="note2">&nbsp;必须</span>
        <%= error_message_on :product, :productcategory_id %>
      </td>
    </tr>
    <tr>
      <th><label><%= Product.human_attribute_name("name") %>:</label></th>
      <td>
        <%= form.text_field :name %><span class="note2">&nbsp;必须</span>
        <%= error_message_on :product, :name %>
      </td>
    </tr>

    <tr>
      <th><label><%= Product.human_attribute_name("image") %>:</label></th>
      <td>
        <%= fckeditor_textarea("product", "introduction", :toolbarSet => 'Simple', :width => '100%', :height => '500px') %> <span class="note2">&nbsp;必须</span>
        <%= error_message_on :product, :introduction %>
      </td>
    </tr>

    <tr>
      <th><label><%= Product.human_attribute_name("introduction") %>:</label></th>
      <td>
        <% if action_name=='update'||action_name=='edit' %>
          <% if  @product.image_file_name.blank? %>
            无图片
          <% else %>
            <%= image_tag  @product.image.url(:thumb) %>
          <% end %>
        <% end %><br />
        <%= form.file_field :image %><span class="note2">&nbsp;必须</span>
        <%= error_message_on :product, :image %>
      </td>
    </tr>
    <!--
    <tr>
      <th><label><%= Product.human_attribute_name("is_public") %>:</label></th>
      <td>
    <%= form.check_box  :is_public%><span class="note2">&nbsp;必须</span>
    <%= error_message_on :product, :is_public %>
      </td>
    </tr>
    -->
    <tr><td  class="center" colspan="2"><%= form.submit t('labels.save'), :class => 'btn_s' %></td></tr>
  </table>
<% end %>
<div class="link-right">
  <%= link_to '返 回', admin_products_path, :class=>"link_s"%>
</div>